# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0

name                libraw
version             0.19.5
revision            1

description         Library for RAW image manipulation
long_description    A library for reading RAW files obtained from digital photo \
                    cameras (CRW/CR2, NEF, RAF, DNG, and others).

categories          graphics
platforms           darwin
license             {LGPL-2.1 CDDL}
maintainers         nomaintainer

homepage            https://www.libraw.org
master_sites        ${homepage}/data/
distname            LibRaw-${version}

checksums           rmd160  051642cfdf713e1d981a1790f4d872d89ff6f02a \
                    sha256  40a262d7cc71702711a0faec106118ee004f86c86cc228281d12d16da03e02f5 \
                    size    1303806

depends_build       port:pkgconfig

depends_lib         port:jasper \
                    port:jpeg \
                    port:lcms2

# disable openmp as it is not consistently applicable in MacPorts at present
configure.args-append --disable-openmp

# don't hardcode a link against libstc++
patchfiles-append   patch-libraw-no-libstdcxx.diff

post-destroot {
    set htmlDir ${destroot}${prefix}/share/doc/${name}/html
    xinstall -d -m 0755 ${htmlDir}
    xinstall -m 644 {*}[glob -directory ${worksrcpath}/doc/ *.html] ${htmlDir}
}

livecheck.type      regex
livecheck.url       ${homepage}/download/
livecheck.regex     "LibRaw-(\\d+(?:\\.\\d+)*)${extract.suffix}"
